using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace HX.Model.Xcode.HXDB
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [BindTable("AppPresidentLicense", Description = "", ConnName = "HXDB", DbType = DatabaseType.SqlServer)]
    public partial class AppPresidentLicense : IAppPresidentLicense
    {
        #region 属性
        private Int64 _id;
        /// <summary></summary>
        [DisplayName("id")]
        [DataObjectField(true, true, false, 19)]
        [BindColumn("id", "", "bigint")]
        public Int64 id { get => _id; set { if (OnPropertyChanging(__.id, value)) { _id = value; OnPropertyChanged(__.id); } } }

        private String _LoginName;
        /// <summary></summary>
        [DisplayName("LoginName")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("LoginName", "", "nvarchar(50)")]
        public String LoginName { get => _LoginName; set { if (OnPropertyChanging(__.LoginName, value)) { _LoginName = value; OnPropertyChanged(__.LoginName); } } }

        private Int32 _IsAgree;
        /// <summary></summary>
        [DisplayName("IsAgree")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("IsAgree", "", "int")]
        public Int32 IsAgree { get => _IsAgree; set { if (OnPropertyChanging(__.IsAgree, value)) { _IsAgree = value; OnPropertyChanged(__.IsAgree); } } }

        private DateTime _OperDate;
        /// <summary></summary>
        [DisplayName("OperDate")]
        [DataObjectField(false, false, true, 3)]
        [BindColumn("OperDate", "", "datetime", Precision = 0, Scale = 3)]
        public DateTime OperDate { get => _OperDate; set { if (OnPropertyChanging(__.OperDate, value)) { _OperDate = value; OnPropertyChanged(__.OperDate); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.id: return _id;
                    case __.LoginName: return _LoginName;
                    case __.IsAgree: return _IsAgree;
                    case __.OperDate: return _OperDate;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.id: _id = value.ToLong(); break;
                    case __.LoginName: _LoginName = Convert.ToString(value); break;
                    case __.IsAgree: _IsAgree = value.ToInt(); break;
                    case __.OperDate: _OperDate = value.ToDateTime(); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得AppPresidentLicense字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary></summary>
            public static readonly Field id = FindByName(__.id);

            /// <summary></summary>
            public static readonly Field LoginName = FindByName(__.LoginName);

            /// <summary></summary>
            public static readonly Field IsAgree = FindByName(__.IsAgree);

            /// <summary></summary>
            public static readonly Field OperDate = FindByName(__.OperDate);

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得AppPresidentLicense字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary></summary>
            public const String id = "id";

            /// <summary></summary>
            public const String LoginName = "LoginName";

            /// <summary></summary>
            public const String IsAgree = "IsAgree";

            /// <summary></summary>
            public const String OperDate = "OperDate";
        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface IAppPresidentLicense
    {
        #region 属性
        /// <summary></summary>
        Int64 id { get; set; }

        /// <summary></summary>
        String LoginName { get; set; }

        /// <summary></summary>
        Int32 IsAgree { get; set; }

        /// <summary></summary>
        DateTime OperDate { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}